<?php

namespace app\models;

use Yii;
use yii\base\Model;
use yii\db\ActiveRecord;

class Addnews extends ActiveRecord{
	public $image;

	public static function model($className=__CLASS__){
		return parent::model($className);
	}

	public static function tableName(){
		return '{{%addnews}}';
	}

	public function rules(){
		return[
			['title','required','message'=>'标题不能为空'],
			['digest','required','message'=>'摘要不能为空'],
			['content','required','message'=>'内容不能为空'],
			['photo','file','extensions' => ['jpg','png','gif'], 'skipOnEmpty' => false,'uploadRequired'=>'请上传文件!','message'=>'上传失败!'],
		];
	}

	
}